package com.shujunjun.shardingdemo.controller;

import com.shujunjun.shardingdemo.entity.CasesDO;
import com.shujunjun.shardingdemo.service.ICaseService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDateTime;

/**
 * @author will
 * @since 2025/3/8 17:31
 */
@RestController
public class CaseController {

    final ICaseService caseService;

    CaseController(ICaseService caseService) {
        this.caseService = caseService;
    }

    @GetMapping(value = "t1")
    public void t1() {
        CasesDO caseDo = new CasesDO();
        caseDo.setPicUrl("http://123123.com");
        caseDo.setDetails("details ...");
        caseDo.setOrderNum(1);
        caseDo.setCreateTime(LocalDateTime.now());
        caseService.save(caseDo);
    }
}
